package 多线程.线程状态.BLOCKED;

public class Main {

    public static void main(String[] args) throws InterruptedException {
        Object block = new Object();
        Thread t1 = new Thread(()->{
            synchronized (block) {
                try {
                    System.out.println("t1");
                    Thread.sleep(5000*5);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        Thread t2 = new Thread(()->{
            synchronized (block) {
                try {
                    Thread.sleep(5000*2);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        t1.start();
        t2.start();
        t1.join();
        t2.join();
    }
}
